from django.db import models
from django.contrib.auth.models import User

class Badge(models.Model):
    user = models.ManyToManyField(User, related_name="badges")
    db_name = models.CharField(max_length = 20)
    title = models.CharField(max_length = 50)
    description = models.CharField(max_length = 150)
    
    LEVEL_CHOICES = (
        ("b", "Bronze"),
        ("s", "Silver"),
        ("g", "Gold"),             
        )
    
    level = models.CharField(max_length=1, choices=LEVEL_CHOICES)
    
    def __str__(self):
        return self.title